package com.dhj.jvmstudy.chapter04;

/**
 * 方法引用与虚方法
 */
public interface Friendly {
    void sayHello();
    void syaGoodBye();
}

class Dog2 {
    public void sayHello(){

    }
    public String toString (){
        return "Dog";
    }
}

class Cat2 implements Friendly {
    @Override
    public void sayHello(){

    }

    @Override
    public void syaGoodBye() {

    }

    protected void finalize(){

    }
}

class CockerSpaniel extends Dog2 implements Friendly {

    public void sayHello (){
        super.sayHello();
    }

    @Override
    public void syaGoodBye() {

    }

}
